from selenium.webdriver.common.by import By

byid = By.ID
byname = By.NAME
bycname = By.CLASS_NAME
bytname = By.TAG_NAME
bylink = By.LINK_TEXT
bycss = By.CSS_SELECTOR
byxpath = By.XPATH
byparriallike = By.PARTIAL_LINK_TEXT



"""交易管理页面"""

class Payment_Order:
    # 交易管理
    transaction_management_click = bycss, '#sidebar > div.accordion.dwz-accordion > div:nth-child(9) > h2'
    # 支付订单管理
    payment_order_click = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[10]/ul/li[2]/div/a'
    # 商户编号
    user_number_input = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr[1]/td[1]/input'
    # 商户名称：
    user_name_input = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[4]/div[1]/form/div/table/tbody/tr[1]/td[2]/input'
    # 商户订单号
    user_order_input =  byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[4]/div[1]/form/div/table/tbody/tr[1]/td[3]/input'
    # 选择状态
    select_state = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(4) > div.pageHeader > form > div > table > tbody > tr:nth-child(1) > td:nth-child(4) > select'
    # option:value,text, index
    # value
    value1 = 'CREATED'
    value2 = 'SUCCESS'
    value3 = 'FAILED'
    value4 = 'WAITING_PAYMENT'
    value5 = 'CANCELED'
    # text
    text1 = '请选择'
    text2 = '订单已创建'
    text3 = '交易成功'
    text4 = '交易失败'
    text5 = '等待支付'
    text6 = '订单已取消'
    # index
    index1 = 0
    index2 = 1
    index3 = 2
    index4 = 3
    index5 = 4
    index6 = 5
    # 下单开始日期
    order_start_data = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(4) > div.pageHeader > form > div > table > tbody > tr:nth-child(2) > td:nth-child(1) > input'
    # 年
    select_start_year = byname, 'year'
    # 2024
    vaule_year = '2024'
    text_year = '2024'
    # 月
    select_start_month = byname, 'month'
    # 12月
    value_month = '12'
    text_month = '十二月'
    # 日:13
    day_start = bycss, '#calendar > div > div.body > dl.days > dd:nth-child(15)'
    # 确定
    sure_btn = bycss, '#calendar > div > div.foot > button.okBut'
    # 清空
    clear_btn = bycname, 'clearBut'
    # 支付方式
    select_way = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageHeader > form > div > table > tbody > tr:nth-child(3) > td:nth-child(1) > select'
    # 微信
    value_way_wx = '微信'
    # 支付宝
    value_way_zfb = '支付宝'
    # 支付类型
    select_type = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageHeader > form > div > table > tbody > tr:nth-child(3) > td:nth-child(2) > select'
    # 扫码支付
    value_type = '扫码支付'
    # 资金流入类型
    select_fund_type = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageHeader > form > div > table > tbody > tr:nth-child(3) > td:nth-child(3) > select'
    # 商家收款
    value_user_way = 'MERCHANT_RECEIVES'
    # 查询
    query_btn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr[3]/td[4]/div/div/button'
    # 断言商家名称
    dy_user_name = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageContent.j-resizeGrid > div.grid > div.gridScroller > div > table > tbody > tr > td:nth-child(3) > div'
    # 总条数、总页数、当前页数
    page_info = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(2) > div.pageContent.j-resizeGrid > div.panelBar > div.pages > span:nth-child(3)'


payment_order = Payment_Order()




class Payment_Record:
    # 支付记录管理
    payment_record_click = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[10]/ul/li[3]/div/a'
    # 商户编号
    user_number_input = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[1]/td[1]/input'
    # 商户名称：
    user_name_input = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[1]/td[2]/input'
    # 商户订单号
    user_order_input = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[1]/td[3]/input'
    # 选择状态
    select_state = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[1]/td[4]/select'
    # option:value,text, index
    # value
    value1 = 'CREATED'
    value2 = 'SUCCESS'
    value3 = 'FAILED'
    value4 = 'WAITING_PAYMENT'
    value5 = 'CANCELED'
    # text
    text1 = '请选择'
    text2 = '订单已创建'
    text3 = '交易成功'
    text4 = '交易失败'
    text5 = '等待支付'
    text6 = '订单已取消'
    # index
    index1 = 0
    index2 = 1
    index3 = 2
    index4 = 3
    index5 = 4
    index6 = 5
    # 支付方式
    select_way = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[3]/td[1]/select'
    # 微信
    value_way_wx = '微信'
    # 支付宝
    value_way_zfb = '支付宝'
    # 支付类型
    select_type = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[3]/td[2]/select'
    # 扫码支付
    value_type = '扫码支付'
    # 资金流入类型
    select_fund_type = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[3]/td[3]/select'
    # 商家收款
    value_user_way = 'MERCHANT_RECEIVES'
    # 查询
    query_btn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr[3]/td[4]/div/div/button'
    # 断言商家名称
    dy_user_name = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div[2]/div[1]/div[2]/div/table/tbody/tr[1]/td[3]/div'
    # 总条数、总页数、当前页数
    page_info = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(3) > div.pageContent.j-resizeGrid > div.panelBar > div.pages > span:nth-child(3)'



payment_record = Payment_Record()
